/**
 * leetcode算法题：两数之和
 */
function twoSum(nums, target) {
    for (var i = 0; i < nums.length(); ++i) {
        for (var j = i + 1; j < nums.length(); ++j) {
            if (nums[i] + nums[j] == target) {
                return [i, j]
            }
        }
    }
    return undefined
}

println(twoSum([2, 7, 11, 15], 9))
println(twoSum([3, 2, 4], 6))
println(twoSum([3, 3], 6))
println(twoSum([23, 16, 76, 97, 240, 224, 5, 78, 443, 25], 103))
